package com.service.impl;

import com.bean.Collect;
import com.bean.User;
import com.dao.CollectDao;
import com.dao.impl.CollectDaoImpl;
import com.service.CollectService;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class CollectServiceImpl implements CollectService {

    private CollectDao collectDao=new CollectDaoImpl();
    @Override
    public void add(String collectid, String userid, Integer flowerid, Date createtime) {
        collectDao.add(collectid,userid,flowerid,createtime);
    }

    @Override
    public List<Collect> queryByUser(String userid) {
        return collectDao.queryByUserid(userid);
    }

    @Override
    public void deleteByCollectid(String collectid) {
        collectDao.deleteByCollectid(collectid);
    }

    @Override
    public void deleteByUserid(String userid) {

        collectDao.deleteByUserid(userid);
    }

    @Override
    public List<Map<String, Object>> listqueryByUser(String userid) {
        return collectDao.listquery(userid);
    }

    @Override
    public boolean ajaxQueryId(String userid, Integer flowerid) {
        if(collectDao.existsId(userid,flowerid) ==null){
            return false;
        }else {
            return true;

        }
    }
}
